Esta página muestra las diferentes formas de iniciar FreeCAD y las características de configuración más importantes.
FreeCAD puede iniciarse normalmente, haciendo doble clic en el icono del escritorio o seleccionándolo en el menú de inicio, pero también sr puede iniciar directamente desde la línea de comandos. Esto te permite cambiar algunos de las opciones por defecto de inicio.
Las opciones de la línea de comandos están sujetas a cambios frecuentes, por lo que es conveniente comprobar las opciones actuales escribiendo:
FreeCAD --help
En la respuesta puedes leer los posibles parámetros:
Usage: FreeCAD [options] File1 File2 ... Allowed options: Generic options: -v [ --version ] Prints version string --verbose Prints verbose version string -h [ --help ] Prints help message -c [ --console ] Starts in console mode --response-file arg Can be specified with '@name', too --dump-config Dumps configuration --get-config arg Prints the value of the requested configuration key --set-config arg Sets the value of a configuration key --keep-deprecated-paths If set then config files are kept on the old location Configuration: -l [ --write-log ] Writes FreeCAD.log to the user directory. --log-file arg Unlike --write-log this allows logging to an arbitrary file -u [ --user-cfg ] arg User config file to load/save user settings -s [ --system-cfg ] arg System config file to load/save system settings -t [ --run-test ] arg Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. -r [ --run-open ] arg Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete. -M [ --module-path ] arg Additional module paths -P [ --python-path ] arg Additional python paths --single-instance Allow to run a single instance of the application --safe-mode Force enable safe mode --pass arg Ignores the following arguments and pass them through to be used by a script
In the following table, selected options are described in more detail:
Long option | Corresponding config var name | Synopsis |
---|---|---|
--user-cfg <filename> |
UserParameter | Filename or relative path that ends with a filename. Defaults to user.cfg .
|
--module-path <dir> |
Prepends to AdditionalModulePaths | Directory that contains modules. This option can be given repeatedly to specify multiple directories. |
--get-config <config-var-name> |
most | Outputs the requested value in a popup dialog. Exits upon confirmation with OK. Cannot be used repeatedly. If an unknown/illegal variable name is used, the response is empty. The --console flag is not honored.
|
Options can written in two forms: --long-option arg
and --long-option=arg
.
FreeCAD puede leer algunas de estas opciones desde un archivo de configuración. Este archivo debe estar en la ruta de la papelera y debe llamarse FreeCAD.cfg. Tenga en cuenta que las opciones especificadas en la línea de comandos anulan el archivo de configuración.
Algunos sistemas operativos tienen límites de longitud muy bajos para la línea de comandos. El modo más habitual de evitar esas limitaciones es utilizar un archivo de respuesta. Un archivo de respuesta es simplemente un archivo de configuración que utiliza la misma sintaxis que la línea de comandos. Si la línea de comandos especifica un nombre de archivo de respuesta a utilizar, es cargado y analizado sintáticamente en adición a la línea de comandos:
FreeCAD @ResponseFile.txt
o:
FreeCAD --response-file=ResponseFile.txt
or:
FreeCAD --response-file ResponseFile.txt
Existen varias opciones no visibles por el usuario. Estas opciones son por ejemplo los parámetros de X-Window analizados por el sistema Windows:
FreeCAD normalmente se inicia en el modo de interfaz de usuario gráfico GUI, pero puedes forzar que inicie en modo consola escribiendo:
FreeCAD --console
desde la línea de comandos. En el modo consola, no se mostrará el interfaz de usuario, y tendrás presente la consola del interprete de Python. Desde ella tienes la misma funcionalidad que desde el interprete de Python que se ejecuta dentro del interfaz de usuario gráfico GUI de FreeCAD, y acceso normal a todos los módulos y plugins de FreeCAD, exceptuando el módulo FreeCADGui. Ten en cuenta que los módulos que dependan del FreeCADGui podrían tampoco estar disponibles.
To read more about console or headless mode, refer to Headless FreeCAD.
File type | System | Command line example |
---|---|---|
Module | Windows | "C:\Program Files\FreeCAD\bin\FreeCAD.exe" -M "C:\FreeCAD\Mod\Draft"
|
Linux | FreeCAD_0.19 -M ~/.FreeCAD/Mod/Draft
| |
Linux (AppImage) | path/to/FreeCADXXX.AppImage -M ~/.FreeCAD/Mod/Draft
| |
.FCMacro or .py | Windows | "C:\Program Files\FreeCAD\bin\FreeCAD.exe" "C:\Users\userName\AppData\Roaming\FreeCAD\Mod\WorkFeature\start_WF.FCMacro"
|
Linux | FreeCAD_0.19 ~/.FreeCAD/Mod/WorkFeature/start_WF.FCMacro
| |
Linux (AppImage) | path/to/FreeCADXXX.AppImage ~/.FreeCAD/Mod/WorkFeature/start_WF.FCMacro
|
See Macro at Startup on how to set up a macro to automatically run at FreeCAD startup.
FreeCAD supports the following environment variables, which can be used to configure directories: introduced in version 0.19
Environment variable | Corresponding config var name | Synopsis |
---|---|---|
FREECAD_USER_HOME |
UserHomePath | FreeCAD's "base" directory for keeping local user data. |
FREECAD_USER_DATA |
UserAppData | If not set, defaults to FREECAD_USER_HOME/.FreeCAD , but only if FREECAD_USER_HOME is set.
|
FREECAD_USER_TEMP |
AppTempPath | If not set, defaults to FREECAD_USER_HOME/temp , but only if FREECAD_USER_HOME is set.
|
If the specified path does not exist, the setting is ignored!
The above environment variables are meant to be used to realize a portable FreeCAD environment. For an example how environment variables can be used from the command line on Linux refer to the notes for Linux users on the downloads page.
HOME
FreeCAD uses Qt, which does honor the HOME
environmental variable. Thus, setting HOME
can be used to specify the base directory of Qt-related configuration files (.config/FreeCAD/FreeCAD.conf
).
FreeCad itself does not honor the HOME
environmental variable (because it determines the user's home directory from a lower-level system API). Use FREECAD_USER_HOME
for this pupose.
TMPDIR
The default temporary directory is /tmp/. The TMPDIR
environmental variable can be used to override the default. (Editor: precedence?).
Algunas bibliotecas necesitan llamar a variables de entorno del sistema. A veces cuando existe un problema con una instalación de FreeCAD, es porque algunas variables de entorno no están o se han definido mal. Por tanto, algunas variables importantes son duplicadas en la Configuración y guardadas en el archivo de registro.
Variables de entorno relativas a Python:
Variables de entorno relativas a OpenCascade:
En cada inicio FreeCAD examina sus alrededores y los parámetros de la línea de comandos. Esto construye un conjunto de configuración que guarda la esencia de toda la información de la ejecución. Esta información es después utilizada para determinar la ubicación donde guardar los datos del usuario o archivos de registro. También es muy importante para los análisis postmortem. Por lo tanto es guardado en el archivo de registro.
Nombre variable configuración | Sinopsis | Ejemplo M$ | Ejemplo Posix (Linux) |
---|---|---|---|
UserAppData | Ruta donde FreeCAD almacena los datos de la aplicación relativos al usuario. | C:\Documents and Settings\username\Application Data\FreeCAD | /home/username/.FreeCAD |
UserParameter | Archivo donde FreeCAD almacena los datos de la aplicación relativos al usuario. | C:\Documents and Settings\username\Application Data\FreeCAD\user.cfg | /home/username/.FreeCAD/user.cfg |
SystemParameter | Archivo donde FreeCAD almacena datos relativos a la aplicación. | C:\Documents and Settings\username\Application Data\FreeCAD\system.cfg | /home/username/.FreeCAD/system.cfg |
UserHomePath | Ruta de la carpeta de inicio del usuario actual | C:\Documents and Settings\username\My Documents | /home/username |
Note: For Linux distributions, an additional configuration file that relates to Qt may exist at path /home/username/.config/FreeCAD/FreeCAD.conf.
Nombre variable configuración | Sinopsis | Ejemplo |
---|---|---|
LoggingFile | 1 si el logging está activado | 1 |
LoggingFileName | Nombre de archivo en el que está ubicado el registro | C:\Documents and Settings\username\Application Data\FreeCAD\FreeCAD.log |
RunMode | Esto indica como funcionará el bucle principal. "Script" significa que el archivo de guión dado se llamará y luego se saldrá. "Cmd" ejecuta el interprete de la línea de comandos. "Internal" ejecuta un archivo de guión interno. "Gui" introduce el bucle de eventos de la interfaz de usuario gráfica GUI. "Module" carga un módulo de Python dado. | "Cmd" |
FileName | Su significado depende del modo de ejecución | |
ScriptFileName | Su significado depende del modo de ejecución | |
Verbose | Nivel de verborrea de FreeCAD | "" o "strict" |
OpenFileCount | Mantiene el número de archivos abiertos a través de argumentos de la línea de comandos | "12" |
AdditionalModulePaths | Mantiene las rutas de módulos adicionales dados en la línea de comandos | "extraModules/" |
Nombre variable configuración | Sinopsis | Ejemplo M$ | Ejemplo Posix (Linux) |
---|---|---|---|
AppHomePath | c:/Progam Files/FreeCAD_0.7 | /user/local/FreeCAD_0.7 | |
PythonSearchPath | Mantiene una lista de las rutas en las cuales Python busca módulos. Esto es al inicio se puede cambiar durante la ejecución |
La tabla de abajo muestra la información disponible sobre la versión de construcción. La mayoría proviene del repositorio de Subversion. Esto es necesario para reconstruir exactamente una versión!
Nombre variable configuración | Sinopsis | Ejemplo |
---|---|---|
BuildVersionMajor | Número de versión principal de la construcción. Definida en src/Build/Version.h.in | 0 |
BuildVersionMinor | Número de versión secundario de la construcción. Definida en src/Build/Version.h.in | 7 |
BuildRevision | Número de revisión del repositorio SVN del src en la construcción. Generado por SVN | 356 |
BuildRevisionRange | Rango de diferentes cambios | 123-356 |
BuildRepositoryURL | URL del repositorio | https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk/src |
BuildRevisionDate | Fecha de la revisión de arriba | 2007/02/03 22:21:18 |
BuildScrClean | Indica si el código fuente fue modificado después de su descarga | Src modified |
BuildScrMixed | Src not mixed |
Estas entradas de configuración son relativas al mecanismo de marcado de FreeCAD. Mira Marcado para más detalles.
Nombre variable configuración | Sinopsis | Ejemplo |
---|---|---|
ExeName | Nombre del archivo ejecutable de la construcción. Puede diferir de la de FreeCAD si es utilizado un main.cpp diferente. | FreeCAD.exe |
ExeVersion | Versión global mostrada al inicio | V0.7 |
AppIcon | Icono que es utilizado por el ejecutable, mostrado en Application MainWindow. | "FCIcon" |
ConsoleBanner | Banner que es mostrado en modo consola | |
SplashPicture | Nombre del icono utilizado por la pantalla de bienvenida | "FreeCADSplasher" |
SplashAlignment | Alineación del texto en el letrero de diálogo de bienvenida | Left" |
SplashTextColor | Color del texto de bienvenida | "#000000" |
StartWorkbench | Nombre del entorno que comenzará automáticamente después del inicio | "Part design" |
HiddenDockWindow | Lista de dockwindows (separadas por un punto y coma) que serán mostradas | "Property editor" |
From FreeCAD's Python console
Entries of the configuration set can be queried with the config var name (see tables above) from the Python console. For example:
>>> FreeCAD.ConfigGet("ExeVersion") '0.19'
If the name is not found, an empty string is returned.
From command line
Use the --get-config <config-var-name>
option to query a single name. Not all names are supported. For example:
FreeCAD --get-config ExeVersion
Use the --dump-config
option to get a list of names and their values. Not all names are supported.
From FreeCAD console
Start FreeCAD in console mode with --console
and query with Python code. For example:
$ FreeCAD --console [FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>] >>> FreeCAD.ConfigGet("ExeVersion") '0.19' >>> exit()
For Linux (bash shell) you can modify the following command line to suit your needs:
$ FreeCAD --console <<EOF print( "FREECAD_USER_HOME: " + ( "not set" if ( os.environ.get('FREECAD_USER_HOME') is None ) else os.environ.get('FREECAD_USER_HOME') ) ) print( "UserHomePath: " + FreeCAD.ConfigGet("UserHomePath") ) exit() EOF
The following assumes that your desktop is configured such that you can launch FreeCAD from it. Depending on your Linux distribution and desktop environment, you may have to adapt the following steps:
Exec
.Windows
Put the FreeCAD executable, FreeCAD.exe, on the USB medium. Create a batch file, FreeCAD.bat, and put it into the same directory as FreeCAD.exe. Inside the batch file write:
set CURRENTDIR=%cd%
set FREECAD_USER_HOME=%CURRENTDIR%
start FreeCAD.exe -u FreeCAD/user.cfg -s FreeCAD/system.cfg --write-log
Or with FREECAD_USER_DATA
(see):
set CURRENTDIR="%cd%"
set FREECAD_USER_DATA=%CURRENTDIR%/..
start FreeCAD.exe -u %FREECAD_USER_DATA%/user.cfg -s %FREECAD_USER_DATA%/system.cfg
With the batch in the root of the USB medium:
set CURRENTDIR=%cd%
set FREECAD_USER_DATA=%CURRENTDIR%FreeCAD\
start %cd%FreeCAD\bin\FreeCAD.exe -u %FREECAD_USER_DATA%user.cfg -s %FREECAD_USER_DATA%system.cfg
Now double-click the batch file to start FreeCAD. (see)